<template>
  <div>
    <ul>
      <li v-for="li in list">
        {{li.nm}}
      </li>
    </ul>
    <!-- <div>
      <img src="~/assets/img.png" alt="">
    </div> -->
    <div>{{count}}</div>
    <div>{{all}}</div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data() {
    return {
      list: []
    }
  },
  async asyncData({$axios, store}) {
    console.log(store)
    let result = await $axios.get('https://m.maoyan.com/ajax/moreComingList?token=&movieIds=894008%2C1298938%2C1302233%2C1048268%2C1309640%2C1336427%2C1299124%2C1339160&optimus_uuid=C265B0800A1411EB9D14AFFCEB030AE4C16BA35ABD8C4380BB7BA4D8785C2D19&optimus_risk_level=71&optimus_code=10')
    return {
      list: result.data.coming
    }
  },
  async fetch({$axios, store}) {
    await $axios.get('https://m.maoyan.com/ajax/moreComingList?token=&movieIds=894008%2C1298938%2C1302233%2C1048268%2C1309640%2C1336427%2C1299124%2C1339160&optimus_uuid=C265B0800A1411EB9D14AFFCEB030AE4C16BA35ABD8C4380BB7BA4D8785C2D19&optimus_risk_level=71&optimus_code=10')
    // store.commit()
  },
  computed: {
    ...mapState(['count']),
    ...mapState('products', ['all'])
  }
}
</script>

<style scoped>
@import '~assets/main.css'
</style>